import Vue from "vue";
import Vuex from "vuex";
import { getToken, setToken } from "@/untils/auth";
Vue.use(Vuex);
const actions = {};

const mutations = {
  City(state, value) {
    state.name = value;
  },
  cityId(state, value) {
    state.id = value;
  },
  SET_TOKEN(state, value) {
    state.token = value;
    setToken(value);
  },
};

const getters = {};

const state = {
  name: "深圳",
  id: "AREA|a6649a11-be98-b150",
  token: getToken() || "",
};

export default new Vuex.Store({
  actions,
  mutations,
  getters,
  state,
});
